package com.gz.controller;

import com.gz.common.ProductService;
import com.gz.common.model.Product;
import com.gz.utils.Response;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

public class ShopController extends Controller {

	public void index() {
		renderJson(Response.responseJson(0, "进入shopController"));
	}
	
	public void fuzzyQueryProductName() {
    	System.out.println("fuzzy in indexController");
		int pageNum=getParaToInt("pageNum");
		int pageSize=getParaToInt("pageSize");
		String name=getPara("name");
		Page<Product> products = ProductService.getService().fuzzyQueryProductName(pageNum, pageSize, name);
		renderJson(Response.responseJson(0, "成功",products));
	}
}
